import request from '@/utils/request.js'


/***藏品相关**/



//获取精选推荐
export function getCollectionList(data) {
	return request({
		url: '/box/collection/CollectionList',
		method: 'post',
		data
	})
}


//获取发售日历列表
export function getCalenderList(data) {
	return request({
		url: '/box/blind_box/list',
		method: 'post',
		data
	})
}


//获取藏品详情
export function getCollectionDetails(id, batch_id) {
	return request({
		url: `/box/collection/ProductDetail/ids/${id}`,
		method: 'post',
		param: {
			batch_id,
		}
	})
}


//获取用户藏品系列列表
export function getUserSeriesList(data) {
	return request({
		url: `/user_collection/user_collection/getList`,
		method: 'post',
		data
	})
}

//获取系列下的藏品列表
export function getListDetail(data) {
	return request({
		url: `/user_collection/user_collection/ListDetail`,
		method: 'post',
		auth: true,
		data
	})
}

//查询用户同一藏品数量
export function getUserCollectionDetailsList(data) {
	return request({
		url: `/user_collection/user_collection/ListGoodsDetail`,
		method: 'post',
		data
	})
}


//查询用户藏品详情
export function getUserCollectionDetails(id) {
	return request({
		url: `/user_collection/user_collection/detail/ids/${id}`,
		method: 'post',
	})
}


//获取转售相关费率
export function getSellConfig(user_collection_id) {
	return request({
		url: `/user_collection/user_collection/show_resale_money`,
		method: "post",
		data: {
			price: 100,
			user_collection_id
		}
	})
}


//转售
export function sellProduct(data) {
	let {
		user_collection_id
	} = data;
	let url = '/user_collection/user_collection/resale'
	if (user_collection_id.split(',').length > 1) {
		url = '/user_collection/user_collection/batch_resale'
	}
	return request({
		url,
		method: "post",
		data
	})
}

//转增
export function givingProduct(data) {
	return request({
		url: '/user_collection/user_collection/reGift',
		method: "post",
		data
	})
}
//转增 有转赠订单
export function reGiftOrder(data) {
	return request({
		url: '/user_collection/user_collection/reGiftOrder',
		method: "post",
		data
	})
}


//获取合成列表
export function getCompoundList(data) {
	return request({
		url: '/user_collection/user_collection/BoxCollectionList',
		method: "post",
		data
	})
}


//获取合成详情
export function getCompoundDetails(box_id) {
	return request({
		url: '/user_collection/user_collection/HaveBoxCollection',
		method: "post",
		data: {
			box_id
		}
	})
}


//合成藏品
export function buildCollection(data) {
	return request({
		url: '/user_collection/user_collection/doBoxCollection',
		method: "post",
		data: data
	})
}

//合成记录
export function getCompoundRecord(data) {
	return request({
		url: '/user_collection/user_collection/compoundLog',
		method: "post",
		data: data
	})
}


//转赠记录
export function getGiveRecord(data) {
	return request({
		url: '/user/aboutGift',
		method: "post",
		data
	})
}


//藏品流转信息
export function getMoveRecord(user_collection_id) {
	return request({
		url: '/user_collection/user_collection/collectionCertificate',
		method: "POST",
		data: {
			user_collection_id
		}
	})
}



/**
 * 获取系列
 */
export function getSeriesList(param) {
	return request({
		url: '/index/getSeries',
		method: "POST",
		param
	})
}


/**
 * 
 *获取自定义系列显示
 *
 **/
export function getSelfSeries(data) {
	return request({
		url: '/index/customSeriesList',
		method: "POST",
		data
	})
}


/**
 * 
 *添加自定义系列显示
 *
 **/
export function addSelfSeries(data) {
	return request({
		url: '/index/customSeriesAdd',
		method: 'post',
		data
	})
}




/**
 * 
 *添加自定义系列显示
 *
 **/
export function removeSelfSeries(data) {
	return request({
		url: '/index/customSeriesDel',
		method: 'post',
		data
	})
}



/**
 * 获取系列下藏品
 * @param {Number} series_id 
 */
export function getSeriesGoodsList(series_id) {
	return request({
		url: '/index/getCollectionGoods',
		method: "POST",
		data: {
			series_id
		}
	})
}


/**
 * 搜索用户藏品
 * @param {*} data 
 */
export function searchUserCollection(data) {
	return request({
		url: '/user_collection/exchange/usercollectionList',
		method: "POST",
		data
	})
}


/**
 * 获取优先购信息
 * @param {*} data 
 */
export function getDiscountBuy(data) {
	return request({
		url: '/box.Collection/getCollectionEarlyPurchaseCoupons',
		method: "POST",
		data
	})
}

// 我的藏列表
export function antMycollection(data) {
	return request({
		url: '/user_collection/user_collection/antMycollection',
		method: "POST",
		data
	})
}

// 添加/移除收藏
export function isCollect(type, data) {
	let url = type == 1 ? '/user_collection/user_collection/dellike' : '/user_collection/user_collection/addlike';
	return request({
		url,
		method: "POST",
		data
	})
}

// 搜索列表
export function likeCollection(data) {
	return request({
		url: '/user_collection/user_collection/likeCollection',
		method: "POST",
		data
	})
}

// 我的藏品详情
export function user_collection_Detail(data) {
	return request({
		url: '/user_collection/user_collection/getDetail',
		method: "POST",
		data
	})
}

// 我的寄售
export function myConsignment(data) {
	return request({
		url: '/order/order/myConsignment',
		method: "POST",
		data
	})
}

// 批量下架
export function batchchangeMarketGoods(data) {
	return request({
		url: '/market/market/batchchangeMarketGoods',
		method: "POST",
		data
	})
}

// 批量下架
export function newList(data) {
	return request({
		url: '/user/newList',
		method: "POST",
		data
	})
}
// 升级产品列表
export function upCollectionList(data) {
	return request({
		url: '/Synthesis/upCollectionList',
		method: "POST",
		data
	})
}



